let bindToGlobal = (obj, key = 'var') => {
    if (typeof window[key] === 'undefined') {
        window[key] = {};
    }

    for (let i in obj) {
        window[key][i] = obj[i]
    }
}

//系统常量
const SystemConstant = {
    //系统token
    TOKEN_KEY: 'sys_token',
    //单点登录token
    SSO_TOKEN_KEY: 'sso_token'
};
bindToGlobal(SystemConstant, "SystemConstant");

//系统枚举
const SystemEnum = {
    //状态
    STATUS: {
        UNKNOWN:{name: 'UNKNOWN',code:-1,info:"未知"},
        STATUS_OFF:{name: 'STATUS_OFF',code:0,info:"停用"},
        STATUS_ON:{name: 'STATUS_ON',code:1,info:"启用"},
    }
};
bindToGlobal(SystemEnum, "SystemEnum");
export default bindToGlobal;